package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    public boolean selectByName(String name,String password) {
        List<User> users = userDao.selectByName(name);
        for (User user : users) {
            if (password.equals(user)){
                return true;
            }
        }
        return false;
    }
}
